#ifndef ABSTRACTMODELITEM_H
#define ABSTRACTMODELITEM_H


#include "model_global.h"


#include <QObject>


class MODELSHARED_EXPORT AbstractModelItem : public QObject
{
    Q_OBJECT

public:

    explicit AbstractModelItem(QObject *parent = 0);
    AbstractModelItem(const AbstractModelItem& other);

    const AbstractModelItem *root() const;

    QList<AbstractModelItem*> childItems() const;

    virtual int fieldCount() const = 0;
    virtual QVariant value(int field, int role = Qt::DisplayRole) const = 0;
    virtual bool setValue(int field, const QVariant& value, int role = Qt::EditRole) = 0;

    virtual QVariant fieldName(int field) const = 0;

    void setParent(QObject * object);


signals:

    void sigChanged();


protected slots:

    virtual void onReparent();

    virtual void onInitialize();

    
};

#endif // ABSTRACTMODELITEM_H
